﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace 功能测试项目
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            byte[] buff = new byte[16];
            byte[] buf = ConvertFun.strToToHexByte(textBox1.Text);

            Array.Copy(buf, buff, buf.Length);

            buff[14] = ConvertFun.buffer_crc1(0, (byte)(buff.Length-2), buff);
            buff[15] = ConvertFun.buffer_crc2(0, (byte)(buff.Length-1), buff);

            textBox2.Text = buff[14].ToString("X2");
            textBox3.Text = buff[15].ToString("X2");
        }
    }
}
